home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / biz / demo / origins.lzh / ARexx / No_Rexx.rexx < prev   
OS/2 REXX Batch file  |  1992-10-16  |  2KB  |  66 lines

  1. /********************************************/
  2. /* Edit a SOURCE or NOTE file from Origins */
  3. /********************************************/
  4.  
  5. /* NOTE: 
  6.    This file is the same as EditGen.rexx, except it is written for those
  7.    situations where your editor of choice doesn't have an ARexx port.  As
  8.    written this script will attempt to start the editor Memacs, from the
  9.    Extras disk.
  10.  
  11.    To function correctly, this script must be renamed EditGen.rexx and copied
  12.    to the REXX: directory.
  13.  
  14.    This script will attempt to start your editor of choice, and load the
  15.    SOURCE or NOTE file requested by Origins.  Because Origins cannot talk to
  16.    your editor, it will start a new invocation for each file.  After you have
  17.    completed editing and saved a file, quit the editor.  Failure to remember
  18.    this will result in many copies of the editor running simultaneously, and
  19.    using a great deal of memory unnecessarily.
  20.  
  21.    Memacs does a ScreenToFront() when called.  If your editor doesn't do
  22.    this, you'll have to switch to the Workbench screen to see it.
  23. */
  24.  
  25. /* Enable error handling routines */
  26. Signal On Error
  27. Signal On Syntax
  28. Signal On Halt
  29. Signal On IOErr
  30.  
  31. /* Change this string to the name of your editor */
  32. /* Make sure to include the space after the name */
  33. Editor = 'Memacs '
  34.  
  35. /* Get the name of the file to edit into this variable */
  36. parse arg Filename
  37.  
  38. /* Start the editor on this file */
  39. address command 'run 'Editor Filename
  40.  
  41. Exit
  42.  
  43. /**********************************************************************/
  44. /*                           Error Handling                           */
  45. /**********************************************************************/
  46.  
  47. Error:
  48.     Parse Source Type Num MacroName Script Prog Port
  49.     say 'ERROR: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
  50.     exit
  51.  
  52. Syntax:
  53.     Parse Source Type Num MacroName Script Prog Port
  54.     say 'SYNTAX: Macro "'MacroName'", Error: #'RC' ("'ErrorText(RC)'") on line 'SIGL' **'
  55.     exit
  56.  
  57. Halt:
  58.     Parse Source Type Num MacroName Script Prog Port
  59.     say 'HALT: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
  60.     exit
  61.  
  62. IOErr:
  63.     Parse Source Type Num MacroName Script Prog Port
  64.     say 'IOERR: Macro "'MacroName'", Error: #'RC' on line 'SIGL' **'
  65.     exit
  66.